<template>
  <div>
    <van-sticky>
      <van-nav-bar title="购物车" @click-left="onClickLeft">
        <template #left>
          <van-icon name="arrow-left" size="18" />
        </template>
      </van-nav-bar>
    </van-sticky>
    <!-- 选购项 -->
    <cart></cart>
    <div style="height: 40px;"></div>
    <!-- 提交栏 -->
    <van-submit-bar :price="price" button-text="提交订单" @submit="onSubmit">
      <van-checkbox v-model="checked">全选</van-checkbox>
    </van-submit-bar>
  </div>
</template>

<script>
import cart from "@/components/cartItem.vue"
import { Toast } from 'vant';
export default {
  components: { cart },
  data() {
    return {
      checked: false,
      price:0
    }
  },
  methods: {
    onClickLeft() {
      Toast('返回');
    },
    onSubmit() {
      Toast('点击了按钮')
    }
  },
};
</script>

<style lang="scss" scoped>
.van-nav-bar {
  height: 50px;
  padding-top: 10px;
  line-height: 50px;
}
.van-nav-bar .van-icon {
  color: #000;
}
[class*=van-hairline]::after{
  border-bottom: 1px solid #ccc;
  margin-bottom: 5px;
}
.van-submit-bar{
  padding: 15px 0;
  border-top: 1px solid #ccc;
}
</style>